<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>v-on:click</title>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
  </head>
  <body>
    <div id="app">
      <div>{{num}}</div>
      <button v-on:click="num++">点击1</button>
      <button @click="num++">点击2</button>
      <button @click="handle">点击3</button>
      <button @click="handle()">点击4</button>
    </div>

    <script>
      var vm = new Vue({
        el: '#app',
        data: {
          num: 0,
        },
        methods: {
          handle: function () {
            this.num++;
          },
        },
      });
    </script>
  </body>
</html>
